<?php //var_dump($output['goods']);exit;?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title><?php echo $output['goods']['goods_name'];?>－金银商城 - 找金银网旗下金银珠宝精品商城</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--标准mui.css-->
    <link rel="stylesheet" href="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/css/mui.min.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/css/app.css" />
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/css/zhaojinyin_index.css" />
    <link href="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <script src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/js/mui.min.js"></script>
    <script src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/js/jquery-1.8.0.min.js"></script>
    <script>

        function GetQueryString(name){
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r!=null) return unescape(r[2]); return null;
        }

        var SiteUrl = "http://<?php echo $_SERVER['HTTP_HOST'];?>";
        var ApiUrl = "http://<?php echo $_SERVER['HTTP_HOST'];?>/mobile/";
        var pagesize = 10;
        var WapSiteUrl = "http://<?php echo $_SERVER['HTTP_HOST'];?>/mobile/";
        var goods_id = GetQueryString("goods_id");
        var member_id = "<?php echo $_SESSION['member_id'];?>";

        $(function() {
            $("#tankuang_shop").click(function() { //加入购物车
                if(member_id==''){
                    window.location.href = WapSiteUrl+'index.php?act=login';
                }else{
                    var quantity = parseInt($(".buy-num").val());
                    var key = getcookie('key');//登录标记
                    $.ajax({
                        url:ApiUrl+"/index.php?act=member_cart&op=cart_add",
                        data:{key:key,goods_id:goods_id,quantity:quantity},
                        type:"post",
                        success:function (result){
                            var rData = $.parseJSON(result);
                                if(!rData.datas.error){
                                    $("#tankuang_goods").show();
                                    setTimeout(function() {
                                        $("#tankuang_goods").hide();
                                    }, 1500);
                                }else{
                                    alert(rData.datas.error);
                                }
                        }
                    })
                }
            });
            $("#tankuang_shop2").click(function() {
                $("#abc").show();
                $("#dalog").show();
                var txt = "";
                txt += "Width: " + $("html").width() + "</br>";
                txt += "Height: " + $("html").height();
            });
            $("#669close").click(function() {
                $("#abc").hide();
                $("#dalog").hide();
            });
            $("#abc").click(function() {
                $(this).hide();
                $("#dalog").hide();
            });
            $(".goods_xqul > li").click(function() {
                var shindex = $(this).index();
                $(".goods_xqul > li").removeClass('onxqul');
                $(this).addClass('onxqul');
                $(".xuanxiangka").hide();
                $(".xuanxiangka").eq(shindex).show();
            });
        });
    </script>

    <style>
        .mui-control-content {
            background-color: white;
            min-height: 215px;
        }

        .mui-control-content .mui-loading {
            margin-top: 50px;
        }

        a.mui-active {
            border-bottom: 2px solid #BB9E77 !important;
            color: #BB9E77 !important;
        }

        .dianpulist li {
            float: left;
            width: 25%;
            text-align: center;
        }

        .dianpulist li img {
            width: 95% !important;
            border: 1px solid #EEEEEE;
        }

        .dianpulist li p {
            width: 95% !important;
            margin: 0 auto;
            margin-top: -27px;
            z-index: 1;
            position: relative;
            background: rgba(0, 0, 0, .3);
            text-align: center;
            color: #FFFFFF;
        }

        .mui-table-view-cell {
            background: #FFFFFF !important;
        }
    </style>
    <script type="text/javascript" charset="utf-8">
        mui.init({
            swipeBack: true //启用右滑关闭功能
        });

    </script>
</head>

<body style="padding-bottom: 150px;">

<div class="mui-bar" style="height: 45px;top: 0;">
    <a class="mui-action-back1 mui-icon mui-icon-left-nav mui-pull-left" onClick="javascript:history.back(-1);"></a>
    <!--
        时间：2016-03-24
        描述：右边按钮
    -->
    <a id="gouwuche_goods" class="mui-pull-right goods_che_btn" style="line-height: 40px; color: #333333 !important;"></a>
    <h1 class="mui-title">商品详情</h1>
</div>

<div class="mui-content" style="margin-top: 46px; background: #FFFFFF;">

    <div id="slider" class="mui-slider mui-active">
        <div class="mui-slider-group mui-slider-loop">
            <!-- 额外增加的一个节点(循环轮播：第一个节点是最后一张轮播) -->
            <div class="mui-slider-item mui-slider-item-duplicate">
                <a href="#">
                    <img style="width: 100%; height: 350px;" src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $output['goods']['goods_image'];?>">
                </a>
            </div>
            <!-- 第一张 -->
            <div class="mui-slider-item">
                <a href="#">
                    <img style="width: 100%; height: 350px;" src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $output['goods']['goods_image'];?>">
                </a>
            </div>
            <!-- 第二张 -->
            <div class="mui-slider-item">
                <a href="#">
                    <img style="width: 100%; height: 350px;" src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $output['goods']['goods_image'];?>">
                </a>
            </div>
            <!-- 第三张 -->
            <div class="mui-slider-item">
                <a href="#">
                    <img style="width: 100%; height: 350px;" src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $output['goods']['goods_image'];?>">
                </a>
            </div>
            <!-- 第三张 -->
            <div class="mui-slider-item">
                <a href="#">
                    <img style="width: 100%; height: 350px;" src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $output['goods']['goods_image'];?>">
                </a>
            </div>

            <!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
            <div class="mui-slider-item mui-slider-item-duplicate">
                <a href="#">
                    <img style="width: 100%; height: 350px;" src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $output['goods']['goods_image'];?>">
                </a>
            </div>
        </div>
        <div class="mui-slider-indicator">
            <div class="mui-indicator mui-active"></div>
            <div class="mui-indicator"></div>
            <div class="mui-indicator"></div>
            <div class="mui-indicator"></div>
        </div>
    </div>

    <div style="padding: 10px; border-top: 1px solid #DDDDDD;">

        <div style="float: left;width: 80%; line-height: 30px;">
            <h4 class="font_sz_16"><?php echo $output['goods']['goods_name']; ?></h4>
            <label class="color_red font_sz_16">￥<?php echo $output['goods']['goods_promotion_price']; ?></label>
            <label style="text-decoration: line-through;color: #666666;">￥<?php echo $output['goods']['goods_price']; ?></label>
            <?php if($output['goods']['goods_promotion_price']/$output['goods']['goods_price']!=1){?><label class="red_but"><?php echo round($output['goods']['goods_promotion_price']/$output['goods']['goods_price']*10,1)?>折</label><?php }?>
        </div>
        <div style=" float: right; border-left: 1px solid #EEEEEE;padding-left: 20px;">
            <img style="width: 25px;" src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/fenxiang1956.png" />
        </div>&nbsp;
        <div class="clear"></div>
        <label style="width: 33%;float: left;color: #666666;"><?php echo ($output['goods']['goods_freight']>0) ? $output['goods']['goods_freight']."元":"包邮";?></label>
        <label style="width: 33%;float: left;color: #666666;text-align: center;">库存<?php echo $output['goods']['goods_storage'];?></label>
<!--        <label style="width: 33%;float: left;color: #666666;text-align: right;">湖南郴州</label>-->
    </div>
    <div class="clear"></div>
    <div style="border-bottom: 1px solid #DDDDDD; height: 10px; margin-bottom: -21px;"></div>&nbsp;

    <!--<div style="padding:0px 10px 10px 10px; color: #666666;height: 50px;line-height: 50px;">
        <label style="margin-right: 5px;"><img style="vertical-align: middle;margin-right: 5px;" src="images/dian09.png" />全店满2件减6元</label>
        <label><img style="vertical-align: middle;margin-right: 5px;" src="images/dian09.png" />全店满500元减50元</label>
        <label style="float: right;">更多> </label>
    </div>
    <div style="width:100%; height: 10px; background: #EEEEEE;"></div>
    <div style="padding:0px 10px 10px 10px; color: #666666;height: 50px;line-height: 50px;">
        <label>请选择尺寸规格</label>
        <label style="float: right;">> </label>
    </div>-->
    <div style="width:100%; height: 10px; background: #EEEEEE;"></div>
    <div style="background: #FFFFFF !important; float: left;padding-bottom: 10px;display: none;">

        <div id="goods_pingluen" style="padding:0px 10px 10px 10px; color: #666666; height: 50px;line-height: 50px;"><?php echo $lang['goods_index_evaluation'];?><em><?php echo $output['goods_evaluate_info']['all'];?></em>
            <label style="float: right;">更多> </label>
        </div>
        <div class="clear"></div>
        <!--div style="border-top: 1px solid #DDDDDD; width: 95%; margin: 0 auto;">
            <img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/w27.png" style="vertical-align: middle; width: 60px;margin: 8px 8px 0;" />
            <label style=" color: #333333;">Juliet</label>

            <div style="padding:0px 10px 0px 10px; color: #666666;">宝贝不错，好喜欢好喜欢，物流也很快哦
                <p>2016-02-23 &nbsp;&nbsp; 颜色：银白 &nbsp;&nbsp; 规格：M</p>
            </div>

            <ul class="dianpulist">
                <li><img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/w29.png">
                </li>
                <li><img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/w30.jpg">
                </li>
                <li><img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/w31.jpg">
                </li>
                <li><img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/w34.jpg">
                </li>
            </ul>
        </div-->
        <div class="clear"></div>
        <!--div style="border-top: 1px solid #DDDDDD; width: 95%; margin: 10px auto 0px;">
            <img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/w27.png" style="vertical-align: middle; width: 60px;margin: 8px 8px 0;" />
            <label style=" color: #333333;">Juliet</label>

            <div style="padding:0px 10px 0px 10px; color: #666666;">宝贝不错，好喜欢好喜欢，物流也很快哦
                <p>2016-02-23 &nbsp;&nbsp; 颜色：银白 &nbsp;&nbsp; 规格：M</p>
            </div>

        </div>

        <div style="border-top: 1px solid #DDDDDD; width: 95%; margin: 10px auto 0px;">
            <img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/w27.png" style="vertical-align: middle; width: 60px;margin: 8px 8px 0;" />
            <label style=" color: #333333;">Juliet</label>

            <div style="padding:0px 10px 0px 10px; color: #666666;">宝贝不错，好喜欢好喜欢，物流也很快哦
                <p>2016-02-23 &nbsp;&nbsp; 颜色：银白 &nbsp;&nbsp; 规格：M</p>
            </div>

        </div-->

    </div>

    <div class="clear"></div>

    <div style="width:100%; height: 10px; background: #EEEEEE;"></div>
    <div style="padding: 10px;">

        <div style="float: left;width: 80%; line-height: 30px;">
            <h4 class="font_sz_16"><?php echo $output['goods']['store_name']; ?></h4>
<!--            <label style="color: #666666;" class="font_sz_16">总销量：10.9万</label>-->
<!--            <label style="color: #666666;">&nbsp;&nbsp;收藏数：914468</label>-->

        </div>
        <div style=" float: right;">
            <label style="float: right;color: #333333; border: 1px solid #CCCCCC; padding: 3px 5px 1px 5px;border-radius: 3px;">+ 收藏</label>
        </div>&nbsp;
        <div class="clear"></div>
        <!--<label style="width: 33.3%;float: left;color: #666666;">宝贝描述
            <label class="color_red">4.9</label>
            <label class="bg_red_color_w">高</label>
        </label>
        <label style="width: 33.3%;float: left;color: #666666;text-align: center;">卖家服务
            <label class="color_red">4.9</label>
            <label class="bg_red_color_w">高</label>
        </label>
        <label style="width: 33.3%;float: left;color: #666666;text-align: right;">物流服务
            <label class="color_red">
                4.9</label>
            <label class="bg_red_color_w">高</label>
        </label>
        <div class="clear" style="margin: 10px;"></div>
        <div style="border-bottom: 1px solid #EEEEEE; height: 10px; margin-bottom: -21px;"></div>&nbsp;
        <div style="height: 15px;" class="clear"></div>
        <label style="float: left;color: #bd9f61; border: 1px solid #bd9f61; padding: 3px 5px 1px 5px;border-radius: 3px; width: 45%; text-align: center;">全部商品（128）</label>
        <label style="float: right;color: #bd9f61; border: 1px solid #bd9f61; padding: 3px 5px 1px 5px;border-radius: 3px; width: 45%; text-align: center;"><img style="width: 15px; vertical-align: middle;" src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/goods228.png" />进入店铺</label>
        <div style=" height: 15px;"></div>-->
    </div>
    &nbsp;

</div>
<div class="clear"></div>
<div style="width:100%; height: 10px; background: #EEEEEE;"></div>
<div style="border-bottom: 1px solid #DDDDDD; height: 50px; background: #FFFFFF;">
    <ul class="goods_xqul">
        <li class="onxqul">
            <p style="border-right:1px solid #DDDDDD ;">图文详情</p>
        </li>
        <li>
            <p style="border-right:1px solid #DDDDDD;">商品参数</p>
        </li>
        <li>
            <p>本店推荐</p>
        </li>
    </ul>

    <div class="xuanxiangka" style="min-height: 330px; width: 100%; float: left;">
        <img style="width: 100%;" src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $output['goods']['goods_image'];?>" />
    </div>

    <div class="xuanxiangka" style=" width: 100%; float: left;border-bottom: 1px solid #DDDDDD; padding:0 10px; background: #FFFFFF; display: none;">
        <!--<div style="border-bottom: 1px solid #EEEEEE; height: 45px; line-height: 45px;">
            <label style="width: 25%; float: left;">形状/图案</label>
            <label style="color: #BD9F61; margin-left: 10px;">其他形状/图案</label>
        </div>
        <div style="border-bottom: 1px solid #EEEEEE; height: 45px; line-height: 45px;">
            <label style="width: 25%; float: left;">是否多层</label>
            <label style="color: #BD9F61; margin-left: 10px;">否</label>
        </div>
        <div style="border-bottom: 1px solid #EEEEEE; height: 45px; line-height: 45px;">
            <label style="width: 25%; float: left;">形状</label>
            <label style="color: #BD9F61; margin-left: 10px;">其他形状/图案</label>
        </div>
        <div style="border-bottom: 1px solid #EEEEEE; height: 45px; line-height: 45px;">
            <label style="width: 25%; float: left;">形状</label>
            <label style="color: #BD9F61; margin-left: 10px;">其他形状/图案</label>
        </div>
        <div style="border-bottom: 1px solid #EEEEEE; height: 45px; line-height: 45px;">
            <label style="width: 25%; float: left;">形状</label>
            <label style="color: #BD9F61; margin-left: 10px;">其他形状/图案</label>
        </div>
        <div style="border-bottom: 1px solid #EEEEEE; height: 45px; line-height: 45px;">
            <label style="width: 25%; float: left;">形状</label>
            <label style="color: #BD9F61; margin-left: 10px;">其他形状/图案</label>
        </div>
        <div style="border-bottom: 1px solid #EEEEEE; height: 45px; line-height: 45px;">
            <label style="width: 25%; float: left;">形状</label>
            <label style="color: #BD9F61; margin-left: 10px;">其他形状/图案</label>
        </div>
        <div style="height: 45px; line-height: 45px;">
            <label style="width: 25%; float: left;">形状</label>
            <label style="color: #BD9F61; margin-left: 10px;">其他形状/图案</label>
        </div>-->
        <?php echo $output['goods']['mobile_body'];?>
    </div>

    <div class="xuanxiangka" style="min-height: 330px; width: 100%; float: left; display: none;margin-bottom: 30px;">
        <div>
            <img style="width: 100%; margin: 10px auto;" src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/baobeituijian54251.png" />

            <ul class="pinpai_list" style="padding-top:5px ; background: #FFFFFF; float: left; padding-bottom: 10px;width: 100%;">
                <?php foreach($output['goods_commend'] as $goods_commend){?>
                    <?php if($output['goods']['goods_id'] != $goods_commend['goods_id']){?>
                        <li style="margin-top: 6px;">
                            <div style="border: 1px solid #dddddd; background: #FFFFFF; width: 96%; float: left;">
                                <a href="/mobile/index.php?act=goods&op=goods_body&goods_id=<?php echo $goods_commend['goods_id'];?>"><img style="min-height: 200px;" src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $goods_commend['goods_image'];?>"></a>
                                <label style="float: left;padding-left: 5px;white-space: nowrap;text-overflow: ellipsis; overflow: hidden;width: 100%;"><?php echo $goods_commend['goods_name'];?>...</label>
                                <p style="float: left; padding-left: 5px; width: 100%;">
                                    <label class="color_red">￥<?php echo $goods_commend['goods_promotion_price'];?></label>
                                    <label style="float: right;padding-right:3px;"></label>
                                </p>
                            </div>
                        </li>
                    <?php }?>
                <?php }?>
            </ul>
        </div>
    </div>

</div>
<div class="clear"></div>
<div>
    <img style="width: 100%; margin: 10px auto;" src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/sese04.png" />

    <ul class="pinpai_list" style="padding-top:5px ; background: #FFFFFF; float: left; padding-bottom: 10px;margin-bottom: 50px;width: 100%;">
        <?php foreach ((array) $output['goods_rand_list'] as $g) { ?>
        <li style="margin-top: 6px;">
            <div style="border: 1px solid #dddddd; background: #FFFFFF; width: 96%; float: left;">
                <a href="/mobile/index.php?act=goods&op=goods_body&goods_id=<?php echo $g['goods_id'];?>"><img style="min-height: 200px;" src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $g['goods_image'];?>"></a>
                <label style="float: left;padding-left: 5px;white-space: nowrap;text-overflow: ellipsis; overflow: hidden;width: 100%;"><?php echo $g['goods_name'];?></label>
                <p style="float: left; padding-left: 5px; width: 100%;">
                    <label class="color_red">￥<?php echo $g['goods_price']; ?></label>
                    <label style="float: right;padding-right:3px;"></label>
                </p>
            </div>
        </li>
        <?php }?>

    </ul>
</div>

<style>
    .mui-bar-popover {
        width: 100%;
    }
</style>

<nav class="mui-bar mui-bar-tab " style="text-align: center;">
    <a class="" href="#" style="color: #696969 !important;border-right: 1px solid #DDDDDD;width:14%;float: left; height: 50px;">
        <p style="height: 12px;padding: 5px 0;"><img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/8834.png" style="width: 20px;" /></p>客服</a>
    <a class="" href="" style="color: #696969 !important;border-right: 1px solid #DDDDDD;width: 14%;float: left; height: 50px;">
        <p style="height: 12px;padding: 5px 0;"><img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/29.png" style="width: 20px;" /></p>喜欢</a>
    <a class="" href="#" style="color: #696969 !important;width: 14%;float: left; height: 50px;">
        <p style="height: 12px;"><img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/03.png" style="width: 20px;padding-top: 3px;" /></p>店铺</a>
    <a id="tankuang_shop2" href="#" style="background: #cbac6b; line-height: 50px; color: #FFFFFF !important;width: 29%;float: left;">加入购物车</a>
    <a href="#" style="background: #ab9154; line-height: 50px;color: #FFFFFF !important;width: 29%;float: left;" class="buy-now">立即购买</a>
</nav>
<div id="abc" style="background:rgba(0, 0, 0, 0.28); position:fixed; top: 0; z-index: 88; width: 100%; height: 100%;display: none;">
</div>
<div id="dalog" style=" margin-top: 30%; background:rgba(0, 0, 0, 0.28); position:fixed; top: 0; z-index: 99; width: 100%; height: 100%;display: none;">
    <ul class="mui-table-view" style="">

        <li class="mui-table-view-cell mui-table-view-cell886" style="padding: 0 15px;">
            <label style="float: left;text-align: center;"><img src="/data/upload/shop/store/goods/<?php echo $output['goods']['store_id'];?>/<?php echo $output['goods']['goods_image'];?>" style="width: 60px;border: 1px solid #EEEEEE;"></label>
            <div style="float: left;">
                <label><?php echo $output['goods']['goods_name']; ?></label>
                <br/>
                <label class="color_red">￥<?php echo $output['goods']['goods_price']; ?></label>
            </div>
            <a id="669close" class="mui-tab-item1 font_sz_16" href="#" style="color: #cbac6b!important; width:40px; margin-top: 10px; border: 0 !important; left: 40px;"><img src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/XX150210.png" /></a>
        </li>
        <!--div style="height: 160px; overflow:auto; border-bottom: 1px solid #EEEEEE;">
            <li class="mui-table-view-cell mui-table-view-cell886" style="width: 100% !important;">
                <p>颜色：</p>
                <label class="BD9F61_but">转运珠+40cm项链</label>
                <label class="BD9F61_but">40cm项链</label>
                <label class="BD9F61_but">转运珠</label>
            </li>
            <li class="mui-table-view-cell mui-table-view-cell886">
                <p>尺寸：</p>
                <label class="BD9F61_but">送擦银布+礼盒</label>
                <label class="BD9F61_but">礼盒</label>
                <label class="BD9F61_but">送擦银布</label>
            </li>
        </div-->
        <li class="mui-table-view-cell mui-table-view-cell886" style="padding: 10px 15px 0px;">
            <p>数量：</p>
            <label style="float: left;color: #bd9f61; border: 1px solid #bd9f61; padding: 3px 5px 0px 5px;border-radius: 5px;" id="sub">-</label>
            <input type="text" value="1" name="num" id="num" class="buy-num" style="float:left;width:60px; height:35px;text-align: center;margin-right: 10px;" />
            <label style="float: left;color: #bd9f61; border: 1px solid #bd9f61; padding: 3px 5px 0px 5px;border-radius: 5px;" id="plus">+</label>
        </li>

        <li class="mui-table-view-cell" style="text-align: center; padding: 0;">
            <label id="tankuang_shop" style="background: #cbac6b; color: #FFFFFF;width: 50%;margin: 0px; float: left; height: 50px; line-height: 50px;">加入购物车</label>
            <label style="background: #ab9154; color: #FFFFFF;width: 50%;margin: 0px; float: left; height: 50px; line-height: 50px;" class="buy-now">立即购买</label>
        </li>

    </ul>
</div>

<div id="tankuang_goods" style=" position:fixed;display: none; top:25%;left: 20%; z-index: 9999;">
    <img style="width: 80%;" src="<?php echo MOBILE_RESOURCE_SITE_URL;?>/images/tankuang_03.png" />
</div>
<script src="<?php echo MOBILE_RESOURCE_SITE_URL; ?>/js/jquery.js"></script>
<script language="javascript">
    $("#sub").click(function(){
        if($("#num").val()>1) {
            $("#num").val(parseInt($("#num").val()) - 1);
        }
    });
    $("#plus").click(function(){
        if($("#num").val()<<?php echo $output['goods']['goods_storage'];?>){
            $("#num").val(parseInt($("#num").val()) + 1);
        }
    });


    function getcookie(name){
        var strcookie=document.cookie;
        var arrcookie=strcookie.split("; ");
        for(var i=0;i<arrcookie.length;i++){
            var arr=arrcookie[i].split("=");
            if(arr[0]==name)return arr[1];
        }
        return "";
    }

    function delCookie(name){//删除cookie
        var exp = new Date();
        exp.setTime(exp.getTime() - 1);
        var cval=getcookie(name);
        if(cval!=null) document.cookie= name + "="+cval+"; path=/;expires="+exp.toGMTString();
    }

    //立即购买
    $(".buy-now").click(function (){
        if(member_id==''){
            window.location.href = WapSiteUrl+'index.php?act=login';
        }else{
            var quantity = parseInt($(".buy-num").val());
            var key = getcookie('key');//登录标记
            $.ajax({
                url:ApiUrl+"/index.php?act=member_cart&op=cart_add",
                data:{key:key,goods_id:goods_id,quantity:quantity},
                type:"post",
                success:function (result){
                    var rData = $.parseJSON(result);
                    if(!rData.datas.error){
                        location.href = WapSiteUrl+'index.php?act=shopcart';
                    }else{
                        alert(rData.datas.error);
                    }
                }
            });
        }
    });

    //点击商品规格，获取新的商品
    function arrowClick(self,myData){
        $(self).addClass("current").siblings().removeClass("current");
        //拼接属性
        var curEle = $(".pddc-stock-spec").find("a.current");
        var curSpec = [];
        $.each(curEle,function (i,v){
            curSpec.push($(v).attr("specs_value_id"));
        });
        var spec_string = curSpec.sort().join("|");
        //获取商品ID
        var spec_goods_id = myData.spec_list[spec_string];
        window.location.href = "product_detail.html?goods_id="+spec_goods_id;
    }

    function AddView(){//增加浏览记录
        var goods_info = getcookie('goods');
        var goods_id = GetQueryString('goods_id');
        if(goods_id<1){
            return false;
        }

        if(goods_info==''){
            goods_info+=goods_id;
        }else{

            var goodsarr = goods_info.split('@');
            if(contains(goodsarr,goods_id)){
                return false;
            }
            if(goodsarr.length<5){
                goods_info+='@'+goods_id;
            }else{
                goodsarr.splice(0,1);
                goodsarr.push(goods_id);
                goods_info = goodsarr.join('@');
            }
        }

        addcookie('goods',goods_info);
        return false;
    }
    $(".mui-action-back").click(function(){
       window.location.href = 'index.php';
    });
    $("#gouwuche_goods").click(function(){
        window.location.href ='index.php?act=shopcart';
    })

</script>
</body>

</html>